/*
*	File: CoreBone.h
*	Date: 12/06/2011
*	Author: Ivan Gao
*	Desc:
*/
#ifndef COREBONE_H_
#define COREBONE_H_
#include "CommonDef.h"
#include "Vector.h"
#include "Quaternion.h"
#include <vector>
#include <string>
using namespace std;
class SCoreSkeleton;
class SIMPLEANIMATION_API SCoreBone
{
public:
	SCoreBone (const char * pBoneName);
	~SCoreBone ();
public:
	bool AddChildId (int nChildId);
	void RecursiveCalculateState ();
	vector<int> & GetChildVectorId ();
	const string & GetBoneName () const;
	void SetBoneName (const string & strBondname);
	const vector<int> & GetChildVectorId () const;
	void SetCoreSkeleton (SCoreSkeleton * pCoreSkeleton);
	const SCoreSkeleton * GetCoreSkeleton () const;
	SCoreSkeleton * GetCoreSkeleton ();

	void SetRotation (const SQuaternion & rQua);
	void SetRotationBoneSpace (const SQuaternion & rQua);
	void SetTranslation (const SVector3 & rTrans);
	void SetTranslationBoneSpace (const SVector3 & rTrans);
	const SQuaternion & GetRotation () const;
	const SQuaternion & GetRotationAbsolute () const;
	const SQuaternion & GetRotationBoneSpace () const;
	const SVector3 & GetTranslation () const;
	const SVector3 & GetTranslationAbsolute () const;
	const SVector3 & GetTranslationBoneSpace () const;

	void SetParentId (int nParentId);
	int GetParentId (void) const;
	void Scale (float scale);
private:
	string			m_strBoneName;
	SCoreSkeleton * m_pCoreSkeleton;
	int				m_nParentId;
	vector<int>		m_vecChildId;
	SVector3		m_translation;
	SQuaternion		m_rotation;
	SVector3		m_translationAbsolute;
	SQuaternion		m_rotationAbsolute;
	SVector3		m_translationBoneSpace;
	SQuaternion		m_rotationBoneSpace;

};
#endif // COREBONE_H_